//
//  DownloadTableViewCell.m
//  Project_A
//
//  Created by 房磊 on 15/1/17.
//  Copyright (c) 2015年 Flowers. All rights reserved.
//

#import "DownloadTableViewCell.h"

@implementation DownloadTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createAllViews];
    }
    return self;
}
- (void)createAllViews
{
    self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.contentView.frame.size.width/7, 0, self.contentView.frame.size.width, self.contentView.frame.size.height)];
    self.nameLabel.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:_nameLabel];
    [_nameLabel release];
    self.numberLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.contentView.frame.size.width/9, self.contentView.frame.origin.y+50, self.contentView.frame.size.width/3, 30)];
    self.numberLabel.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:_numberLabel];
    [_numberLabel release];
    
    self.progress = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleDefault];
    _progress.frame = CGRectMake(self.numberLabel.frame.origin.x + self.numberLabel.frame.size.width + 15, self.numberLabel.frame.origin.y + 10, 150, 10);
    _progress.backgroundColor = [UIColor greenColor];
    self.progress.progress = 0.6;
    [self.contentView addSubview:_progress];
    [_progress release];
    
    self.downloadButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.downloadButton.frame = CGRectMake(self.progress.frame.origin.x + self.progress.frame.size.width + 10, self.progress.frame.origin.y- 10, 30, 30);
    self.downloadButton.backgroundColor = [UIColor purpleColor];
    [self.contentView addSubview:_downloadButton];
    [_downloadButton release];

    
}

- (void)setDownloadModel:(DownModel *)downloadModel
{
    if (_downloadModel != downloadModel) {
        [_downloadModel release];
        _downloadModel = [downloadModel retain];
    }
    
    
    
}






- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
